package com.qyhl.webtv.module_news.luckydraw.detail;


import com.qyhl.webtv.commonlib.entity.news.LuckDrawInfoBean;

import java.util.List;

/**
 * Created by Administrator on 2018/6/14.
 */

public class LuckDrawWinnerDetailPresenter implements LuckDrawWinnerDetailContract.LuckDrawWinnerDetailPresenter {
    private LuckDrawWinnerDetailActivity mView;
    private LuckDrawWinnerDetailModel mModel;

    public LuckDrawWinnerDetailPresenter(LuckDrawWinnerDetailActivity mView) {
        this.mView = mView;
        this.mModel = new LuckDrawWinnerDetailModel(this);
    }

    @Override
    public void queryInfo(String phoneNum, String lastId) {
        mModel.queryInfo(phoneNum, lastId);
    }

    @Override
    public void setQueryInfoSuccess(boolean isMore, List<LuckDrawInfoBean> beanList) {
        mView.setQueryInfoSuccess(isMore, beanList);
    }

    @Override
    public void setQueryInfoError(int code, String msg) {
        switch (code) {
            case 0:
                mView.setNetError(msg);
                break;
            case 1:
                mView.showToast(msg);
                break;
            case 2:
                mView.setEmpty(msg);
                break;
            case 3:
                mView.setLog(msg);
                break;
            case 4:
                mView.setQueryInfoError(msg);
                break;
            case 5:
                mView.showToast(msg);
                break;
            default:
                break;
        }
    }
}
